
<?php
$this->headLink()->appendStylesheet($this->baseUrl() . '/public/styles/datepicker/jquery.datepick.css');
$this->headScript()->prependFile($this->baseUrl() . '/public/scripts/datepicker/jquery.datepick.js');
?>

<article class="module width_full">
    <header><h3>Agregar Alcance para la orden "<?php echo $this->title ?>"</h3></header>
    <div class="module_content">
        <?php
        echo $this->form;
        ?>
    </div>
</article>

<div style="display: none;">
    <img id="calImg" src="<?php echo $this->baseUrl() . '/public/img/calendar-blue.gif' ?>" alt="Popup" class="trigger">
</div>

<script>
    index = '<?php echo $this->id ?>';
    var combo = document.getElementById('id_orden');
    var cantidad = combo.length;
    for (i = 0; i < cantidad; i++) {
        if (combo[i].value == index) {
            combo[i].selected = true;
        }   
    }
    $(function() {
        $('#end_date').datepick({
            showOnFocus: false, 
            showTrigger: '#calImg',
            dateFormat: 'dd-mm-yyyy'
        });
        
        $('#finalizar').css({
            'margin-top': '-41px',
            'margin-left': '90px',
            'display': 'table'
        });
        $('#finalizar').click(function(e){
            e.preventDefault();
            location.href = '<?php echo $this->url(array('module' => 'alcance', 'controller' => 'index', 'action' => 'view'), null, true) ?>';
            return false;
        })
      
    });
    
    $('#status-element, #status-label').css("display", "none")
    
    
</script>